package com.tmptSource.utils.dozer;

import com.tmpt.utils.FenAndYuan;
import com.tmpt.utils.StringUtils;
import org.dozer.DozerConverter;

/**
 * Created by wxy on 2017/9/13.
 */
public class FenAndYuan4LongConverter extends DozerConverter<Long,String>{


    public FenAndYuan4LongConverter() {
        super(Long.class, String.class);
    }

    @Override
    public String convertTo(Long source, String destination) {


        /*//.out.println("convertTo");
        //.out.println("convertTo:"+source);
        //.out.println("convertTo:"+destination);*/
        ////.out.println("convertTo:"+getParameter());
        if(source == null)return null;
        return FenAndYuan.fen2yuanStr(source);
    }

    @Override
    public Long convertFrom(String source, Long destination) {
        /*//.out.println("convertFrom");
        //.out.println("convertFrom:"+source);
        //.out.println("convertFrom:"+destination);*/
        ////.out.println("convertTo:"+getParameter());
        if(StringUtils.isNull(source))return null;
        return FenAndYuan.yuan2fenLng(source);
    }
}
